package ren.steve.model.system.bean;

import ren.steve.model.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel(description = "系统菜单和权限")
@TableName("system_menu")
public class SystemMenu extends BaseEntity {
	
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "所属上级")
	@TableField("parent_id")
	private String parentId;

	@ApiModelProperty(value = "名称", required = true)
	@TableField("title")
	private String title;

	@ApiModelProperty(value = "类型(1:集群,2:数据库,3:API,4:模块&页面,5:按钮)", required = true)
	@TableField("type")
	private Integer type;

	@ApiModelProperty(value = "是否隐藏菜单")
	@TableField("hide")
	private Boolean hide;

	@ApiModelProperty(value = "方法")
	@TableField("method")
	private String method;

	@ApiModelProperty(value = "URL或Path地址")
	@TableField("path")
	private String path;

	@ApiModelProperty(value = "组件路径")
	@TableField("component")
	private String component;

	@ApiModelProperty(value = "权限标识", required = true)
	@TableField("code")
	private String code;

	@ApiModelProperty(value = "图标")
	@TableField("icon")
	private String icon;

	@ApiModelProperty(value = "排序", required = true)
	@TableField("sort")
	private Integer sort;

	@ApiModelProperty(value = "子菜单")
	@TableField(exist = false)
	private List<SystemMenu> children = new ArrayList<>();

}

